package edu.ccut.saturn.basecomponent.database.resultset.impl;

import java.sql.ResultSet;
import java.sql.SQLException;

import edu.ccut.saturn.basecomponent.database.resultset.IResultSetSet;
import edu.ccut.saturn.component.SaturnData;

public class ResultSetGetDatetime implements IResultSetSet {

	public void setSaturnData(SaturnData saturnData, String key,
			ResultSet resultSet) throws SQLException {
		String datetime = null;
		if ((datetime = resultSet.getString(key)) != null) {
			
			// 如果是时间，将时间戳的‘.0’去掉
			String value = datetime.split("\\.")[0];
			
			saturnData.set(key, value);
		} else {
			saturnData.set(key, datetime);
		}
	}
}
